home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
...taking it to the Macs!
/
...taking it to the Macs!.iso
/
Extras
/
ActiveX Mac SDK
/
ActiveX SDK
/
Container Common
/
pullstream.h
< prev
next >
Wrap
Text File
|
1997-01-03
|
3KB
|
91 lines
//
// PullStream.H
//
// Copyright (C) Microsoft Corporation, 1996
//
#define STREAM_BUFFER_SIZE 8192
class CPullStreamNotify:
public CNetscapeStreamNotify
{
public:
LPVOID m_pStream;
long m_StreamLength;
long m_ReadyToRead;
virtual ~CPullStreamNotify();
virtual int32 OnWriteReady(NPStream *stream);
virtual int32 OnWrite(NPStream *stream, int32 offset, int32 len, void
*buffer);
};
class CPullOleStreamNotify:
public CPullStreamNotify,
public IStream
{
private:
ULONG m_cRef;
public:
long m_SeekPosition;
BOOL m_fAsyncStreamInProgress;
inline CPullOleStreamNotify();
// *** IUnknown methods ***
STDMETHOD(QueryInterface)(REFIID riid, LPVOID *ppvObj);
STDMETHOD_(ULONG,AddRef)(void);
STDMETHOD_(ULONG,Release)(void);
// *** IStream methods ***
STDMETHOD(Read)(void *pv, DWORD cb, LPDWORD pcbRead);
STDMETHOD(Write)(void const *pv, DWORD cb, LPDWORD pcbWritten);
STDMETHOD(Seek)(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition);
STDMETHOD(SetSize)(ULARGE_INTEGER libNewSize);
STDMETHOD(CopyTo)(LPSTREAM pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten);
STDMETHOD(Commit)(DWORD grfCommitFlags);
STDMETHOD(Revert)(void);
STDMETHOD(LockRegion)(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
STDMETHOD(UnlockRegion)(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
STDMETHOD(Stat)(STATSTG *pstatstg, DWORD grfStatFlag);
STDMETHOD(Clone)(LPSTREAM *ppstm);
};
inline
CPullOleStreamNotify::CPullOleStreamNotify()
{
// Our implementation of the "new" operator will zero the structure so we
// don't have to explicitly zero/null anything.
m_cRef = 1;
}
class CBindingPullStreamNotify:
public CPullOleStreamNotify
{
private:
// Back pointer to the binding object that created this stream.
CXBinding *m_pBinding;
BOOL m_fDeliveredFirstNotify;
public:
inline CBindingPullStreamNotify(CXBinding *pBinding);
virtual int32 OnWrite(NPStream *stream, int32 offset, int32 len, void
*buffer);
virtual NPError OnDestroyStream(NPStream *stream, NPError reason);
};
inline
CBindingPullStreamNotify::CBindingPullStreamNotify(CXBinding *pBinding)
{
// Our implementation of the "new" operator will zero the structure so we
// don't have to explicitly zero/null anything.
m_pBinding = pBinding;
m_ReadyToRead = STREAM_BUFFER_SIZE;
}